package com.jyh.domain;


public class Person {
    public static void main(String[] args) {
        Person person = new Person("张三", 18, "斑马小镇");
        person.setName("恒");
        person.setAge(24);
        person.eat();

    }

    //属性
    //名字
    private String name;
    //年龄
    private int age;
    //地址
    private String address;

    //构造参数
    public Person() {
    }//无参
    public Person(String name, int age, String address) {
        this.name = name;
        this.age = age;
        this.address = address;
    }//满参

    //行为
    public void eat(){
        System.out.println(name+"在"+address+"吃鸡");
    }
    public void sleep(){
        System.out.println(name+"在"+"睡觉");
    }

    //getter and setter
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
